package com.seecen.cywbackend.utils;
import com.seecen.cywbackend.pojo.vo.CommentVO;
import com.seecen.cywbackend.pojo.vo.DynamicVO;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class PageResult<T> {
    private List<T> list;
    private Integer total;
    private Integer pageSize;
    private Integer currentPage;
    private Integer totalPage;

    public PageResult(List<DynamicVO> voList, long total, long size, long current, long pages) {
        this.list = (List<T>) voList;
        this.total = (int) total;
        this.pageSize = (int) size;
        this.currentPage = (int) current;
        this.totalPage = (int) pages;
    }

    public PageResult(List<CommentVO> voList, long total) {
        this.list = (List<T>) voList;
        this.total = (int) total;
    }
}
